<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />

  <script src="https://cdn.staticfile.org/axios/0.19.0-beta.1/axios.js"></script>

  <script src="https://cdn.staticfile.org/vue/2.5.17/vue.js"></script>
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.13.0/theme-chalk/index.css" />
  <script src="https://cdn.staticfile.org/element-ui/2.13.0/index.js"></script>
  <link rel="stylesheet" href="../../../lib/index.css" />
  <script src="../../../lib/avue.js"></script>
</head>

<body>
  <div id="app">
    <avue-crud ref="crud" v-model="form" :before-close="beforeClose" :option="option" :data="data">
      <el-tag slot="name" slot-scope="{row}">
        {{row}}
      </el-tag>
      <el-tag slot="nameHeader" slot-scope="{column}">
        {{column}}
      </el-tag>
      <el-tag slot="nameSearch" slot-scope="{column}">
        123
      </el-tag>
      <el-tag slot="nameForm" slot-scope="{column}">
        456
      </el-tag>
    </avue-crud>
  </div>
</body>
<script>
  new Vue({
    el: '#app',
    data() {
      return {
        form: {},
        data: [{
          name: '张三',
          sex: '男'
        },
        {
          name: '李四',
          sex: '女'
        }],
        option: {
          index: true,
          height: 'auto',
          align: 'center',
          menuAlign: 'center',
          border: true,
          column: [{
            label: '姓名',
            prop: 'name',
            search: true,
            rules: [
              {
                required: true,
                message: '请选择地区',
                trigger: 'blur'
              }
            ]
          }, {
            label: '年龄',
            prop: 'sex',
            search: true
          }]
        }
      }
    },
    methods: {
      beforeClose(done, type) {
        done();
      },
    }
  })
</script>

</html>